package cn.wolfcode.market.controller;

import cn.wolfcode.market.common.Result;
import cn.wolfcode.market.entity.User;
import cn.wolfcode.market.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yinyin
 * @create 2023/07/03 下午 4:42
 */
@RestController
public class UserController {
    @Autowired
    private IUserService userService;


    @GetMapping("listUser")
    public Result getUserList(){
        List<User> users = userService.selectAllUser();
        return Result.ok().data("users",users);
    }
}
